home *** CD-ROM | disk | FTP | other *** search
/ Varios Español / Varios Español.iso / DBWINESP / DISK7 / CBTSAMP.PAK / BOTONES.CC < prev    next >
C/C++ Source or Header  |  1994-11-28  |  9KB  |  240 lines

  1. ************************************************************************************
  2. *  PROGRAMA:      Botones.cc
  3. *
  4. *  ESCRITO POR:   Grupo Borland de ejemplos
  5. *
  6. *  FECHA:         2/94
  7. *
  8. *  ACTUALIZADO:   6/94
  9. *
  10. *  REVISION:     $Revisión:   1.51  $
  11. *
  12. *  VERSION:      dBASE PARA WINDOWS 5.0
  13. *
  14. *
  15. *  DESCRIPCION:  Archivo de procedimientos que contiene las
  16. *                definiciones de clases de los botones más frecuentemente utilizados en
  17. *                las fichas de dBASE para Windows. Estos botones contienen bitmaps, que
  18. *                están incluidos en <_dbwinhome>\bin\dbas0009.dll, y texto.
  19. *                Clases incluidas:
  20. *                   OkButton
  21. *                   CloseButton
  22. *                   CancelButton
  23. *                   YesButton
  24. *                   NoButton
  25. *                   NextButton
  26. *                   PrevButton
  27. *                   HelpButton
  28. *                   InfoButton
  29. *                   ToolButton
  30. *                   ReportButton
  31. *                   BrowseButton
  32. *
  33. *  PARAMETROS:   Cada botón personalizado de este archivo requiere 2 argumentos:
  34. *                F      -- Objecto -- Referencia a la ficha padre
  35. *                Nombre -- Cadena  -- Nombre del control que va a ser creado
  36. *                Ejemplo:
  37. *                   f = new form()
  38. *                   p = new OkButton(f,"miBotonAceptar")
  39. *
  40. *  LLAMADAS:        Ninguna
  41. *
  42. *  UTILIZACION:        SET PROCEDURE TO Botones.cc, then use these classes with:
  43. *                Sintaxis con NEW :  x = new OkButton(f),
  44. *                Sintaxis con DEFINE: define OkButton x of f
  45. *                DISEÑADOR DE FICHAS: Seleccione la clase desde el inspector de clases
  46. *                             personalizadas de DBW al añadir un control a su ficha.
  47. *
  48. *  NOTA:         Ahora mismo el constructor de cada control ejecuta la función
  49. *                MarkCustom(control) para que el control sea correctamente creado durante la
  50. *                generación del código, al ser guardado desde el diseñador de fichas.. Esta acción es
  51. *                temporal, y será reemplazada con la palabra clave CUSTOM
  52. *                en el comando DEFINE <control>.
  53. *******************************************************************************
  54. #include <Dlgsmsgs.h>
  55.  
  56. *******************************************************************************
  57. *******************************************************************************
  58. class OkButton(f,n) of Pushbutton(f,n) custom
  59. *******************************************************************************
  60.  
  61.    this.height = 1.50
  62.    this.width = 14.11
  63.    this.upbitmap = "Resource #20"
  64.    this.disabledbitmap = "Resource #21"
  65.    this.text = "Aceptar"
  66.  
  67. endclass
  68.  
  69. *******************************************************************************
  70. class CloseButton(f,n) of Pushbutton(f,n) custom
  71. *******************************************************************************
  72.  
  73.    this.height = 1.50
  74.    this.width = 14.11
  75.    this.upbitmap = "Resource #20"
  76.    this.disabledbitmap = "Resource #21"
  77.    this.text = "&Cerrar"
  78.    this.OnClick = {;form.Close()}
  79.    this.StatusMessage = "Cierra esta ficha."
  80.  
  81. endclass
  82.  
  83. *******************************************************************************
  84. *******************************************************************************
  85. class CancelButton(f,n) of Pushbutton(f,n) custom
  86. *******************************************************************************
  87.  
  88.    this.height = 1.50
  89.    this.width = 14.11
  90.    this.upbitmap = "Resource #28"
  91.    this.disabledbitmap = "Resource #29"
  92.    this.text = "Cancelar"
  93.    this.OnClick = {;form.Close()}
  94.    this.StatusMessage = "Cancelar esta ficha"
  95.  
  96. endclass
  97.  
  98. *******************************************************************************
  99. *******************************************************************************
  100. class HelpButton(f,n) of Pushbutton(f,n) custom
  101. *******************************************************************************
  102.  
  103.    this.height = 1.50
  104.    this.width = 14.11
  105.    this.upbitmap = "Resource #32"
  106.    this.disabledbitmap = "Resource #33"
  107.    this.text = "Ayuda"
  108.  
  109. endclass
  110.  
  111. *******************************************************************************
  112. *******************************************************************************
  113. class YesButton(f,n) of Pushbutton(f,n) custom
  114. *******************************************************************************
  115.  
  116.    this.height = 1.50
  117.    this.width = 14.11
  118.    this.upbitmap = "Resource #20"
  119.    this.disabledbitmap = "Resource #21"
  120.    this.text = "&Sí"
  121.  
  122. endclass
  123.  
  124.  
  125. *******************************************************************************
  126. *******************************************************************************
  127. class NoButton(f,n) of Pushbutton(f,n) custom
  128. *******************************************************************************
  129.  
  130.    this.height = 1.50
  131.    this.width = 14.11
  132.    this.upbitmap = "Resource #24"
  133.    this.disabledbitmap = "Resource #25"
  134.    this.text = "&No"
  135.  
  136. endclass
  137.  
  138. *******************************************************************************
  139. *******************************************************************************
  140. class NextButton(f,n) of Pushbutton(f,n) custom
  141. *******************************************************************************
  142.  
  143.    this.height = 1.50
  144.    this.width = 14.11
  145.    this.upbitmap = "Resource #100"
  146.    this.text = "Sig&uiente"
  147.    this.StatusMessage = "Ir al registro siguiente."
  148.  
  149.    ****************************************************************************
  150.    procedure OnClick
  151.    ****************************************************************************
  152.    skip
  153.    if eof()
  154.       go bottom
  155.       AlertMessage("Ultimo registro.","Advertencia")
  156.    endif
  157. endclass
  158.  
  159. *******************************************************************************
  160. *******************************************************************************
  161. class PrevButton(f,n) of Pushbutton(f,n) custom
  162. *******************************************************************************
  163.  
  164.    this.height = 1.50
  165.    this.width = 14.11
  166.    this.upbitmap = "Resource #104"
  167.    this.text = "An&terior"
  168.    this.StatusMessage = "Ir al registro anterior"
  169.  
  170.    ****************************************************************************
  171.    procedure OnClick
  172.    ****************************************************************************
  173.    skip - 1
  174.    if bof()
  175.       go top
  176.       AlertMessage("Primer registro.","Advertencia")
  177.    endif
  178.  
  179. endclass
  180.  
  181.  
  182. *******************************************************************************
  183. *******************************************************************************
  184. class InfoButton(f,n) of Pushbutton(f,n) custom
  185. *******************************************************************************
  186.  
  187.    this.height = 1.50
  188.    this.width = 14.11
  189.    this.upbitmap = "Resource #112"
  190.    this.text = "&Info"
  191.  
  192. endclass
  193.  
  194. *******************************************************************************
  195. *******************************************************************************
  196. class ToolButton(f,n) of Pushbutton(f,n) custom
  197. *******************************************************************************
  198.  
  199.    this.height = 1.50
  200.    this.width = 4
  201.    this.upbitmap = "Resource #148"
  202.    this.text = ""
  203.    this.tabstop = .f.
  204.  
  205. endclass
  206.  
  207. *******************************************************************************
  208. *******************************************************************************
  209. class ReportButton(f,n) of Pushbutton(f,n) custom
  210. *******************************************************************************
  211.  
  212.    this.UpBitmap = "RESOURCE #614"
  213.    this.Text = "Informe"
  214.    this.height = 1.50
  215.    this.width = 14.11
  216.  
  217.    ****************************************************************************
  218.    procedure OnClick
  219.    ****************************************************************************
  220.    report form ?
  221.  
  222. ENDCLASS
  223.  
  224. *******************************************************************************
  225. *******************************************************************************
  226. CLASS BrowseButton(f,n) of PushButton(f,n) custom
  227. *******************************************************************************
  228.  
  229.    this.UpBitmap = "RESOURCE #610"
  230.    this.Text = "Browse"
  231.    this.height = 1.50
  232.    this.width = 14.11
  233.  
  234.    ****************************************************************************
  235.    procedure OnClick
  236.    ****************************************************************************
  237.    browse
  238.  
  239. endclass
  240.